<template>
	<view class="tab-Bar-view">
		<view class="row-around tab-Bar">
			<view class="column-div" @click="tabBarClick(0)">
				<image src="../../static/assets/tabBar/chanpin-sel.png" v-if="active == 0"></image>
				<image src="../../static/assets/tabBar/chanpin.png" v-else></image>
				<view :class="{'active-text': active == 0}">产品信息</view>
			</view>
			<view class="column-div" @click="tabBarClick(1)">
				<image src="../../static/assets/tabBar/suyuan-sel.png" v-if="active == 1"></image>
				<image src="../../static/assets/tabBar/suyuan.png" v-else></image>
				<view :class="{'active-text': active == 1}">溯源信息</view>
			</view>
			<view class="column-div" @click="tabBarClick(2)">
				<image src="../../static/assets/tabBar/qiye-sel.png" v-if="active == 2"></image>
				<image src="../../static/assets/tabBar/qiye.png" v-else></image>
				<view :class="{'active-text': active == 2}">企业信息</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props:{
			active: {
				type: Number,
				default: 0
			}
		},
		data() {
			return {
			};
		},
		methods:{
			tabBarClick(e){
				this.active != e ? this.$emit('event', e) : null
			}
		}
	}
</script>

<style scoped lang="scss">
	.tab-Bar-view {
		width: 100%;
		height: 120upx;
		.tab-Bar {
			width: 100%;
			background: #FFFFFF;
			padding: 12upx 0;
			box-shadow: 0px 0px 12upx 0px rgba(68, 68, 68, 0.1);
			position: fixed;
			left: 0;
			bottom: 0;
			z-index: 9;
			image {
				width: 44upx;
				height: 44upx;
				margin-bottom: 8upx;
			}

			.column-div {
				font-size: 20upx;
				font-weight: 500;
				font-family: PingFang SC;
				color: #333333;

				.active-text {
					color: #D92806;
				}
			}
		}
	}
</style>
